<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //includes() 方法用来判断一个数组是否包含一个指定的值，根据情况，如果包含则返回 true，否则返回false。
      const array = [1, 2, 3]
      console.log(array.includes(2))

      const pets = ['cat', 'dog', 'bat']
      console.log(pets.includes('cat'))

      console.log(pets.includes('at'))

      const ins = [1, 2, 3].includes(2)
      console.log(ins)

      //fromIndex大于等于数组长度
      let arr = ['a', 'c', 'd']
      arr.includes('c', 4)
      //console.log(arr)
    </script>
  </body>
</html>
